<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2018/11/20
 * Time: 16:48
 */
namespace common\sources\write\taobao;

use common\sources\write\taobao\ITaoBaoAccess;
use common\models\craftsman\TaoBao;
use Yii;

class TaoBaoAccess implements ITaoBaoAccess
{
    public function addTaoBao($param)
    {
        return Yii::$app->db->createCommand()->insert('taobao', [
            'tbname' =>  $param['tbname'],
            'buy_id' => $param['buy_id'],
            'sex' => $param['sex'],
            'zfbname'=>$param['zfbname'],
            'zfbage' => $param['zfbage'],
            'takename' => $param['takename'],
            'takephone' => $param['takephone'],
            'pro_name' =>$param['pro_name'],
            'pro_code' => $param['pro_code'],
            'city_name' => $param['city_name'],
            'city_code' => $param['city_code'],
            'area_name' => $param['area_name'],
            'area_code' => $param['area_code'],
            'addr' => $param['addr'],
            'zfbname_img' => $param['zfbname_img'],
            'ip_img' => $param['ip_img'],
            'tqz_img' => $param['tqz_img'],
            'addr' => $param['addr'],
            'zfbhb_img' => $param['zfbhb_img'],
            'zfbname_img' => $param['zfbname_img'],
            'create_time' => time(),
            'audit_status' => 1,
        ])->execute();
//        $taobao = new TaoBao();
//        $taobao->tbname = $param['tbname'];
//        $taobao->sex = $param['sex'];
//        $taobao->takename = $param['takename'];
//        $taobao->takephone = $param['takephone'];
//        $taobao->area = $param['area'];
//        $taobao->addr = $param['addr'];
//        $taobao->zfbsex_img = $param['zfbsex_img'];
//        $taobao->ip_img = $param['ip_img'];
//        $taobao->tqz_img = $param['tqz_img'];
//        $taobao->takeaddr = $param['takeaddr'];
//        $taobao->takeaddrs = $param['takeaddrs'];
//        $taobao->zfbname = $param['zfbname'];
//        $taobao->habit_ids = $param['habit_ids'];
//        $taobao->zfbname_img = $param['zfbname_img'];
//        $taobao->sphabit_img1 = $param['sphabit_img1'];
//        $taobao->sphabit_img2 = $param['sphabit_img2'];
//        $taobao->id_img = $param['id_img'];
//        $taobao->zfbnum = $param['zfbnum'];
//        $taobao->create_time = time();
//        $taobao->audit_status = 1;
//        return $taobao->save() ?  $taobao : FALSE;
    }

}